/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
import { index } from "@ohos/protobufjs"; const $protobuf = index;
import Long from 'long';
$protobuf.util.Long=Long
$protobuf.configure()

// Common aliases
const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;

// Exported root namespace
const $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});

export const UserLoginLogResp = $root.UserLoginLogResp = (() => {

    /**
     * Properties of a UserLoginLogResp.
     * @exports IUserLoginLogResp
     * @interface IUserLoginLogResp
     * @property {string|null} [model] UserLoginLogResp model
     * @property {string|null} [loginTime] UserLoginLogResp loginTime
     * @property {string|null} [deviceId] UserLoginLogResp deviceId
     */

    /**
     * Constructs a new UserLoginLogResp.
     * @exports UserLoginLogResp
     * @classdesc Represents a UserLoginLogResp.
     * @implements IUserLoginLogResp
     * @constructor
     * @param {IUserLoginLogResp=} [properties] Properties to set
     */
    function UserLoginLogResp(properties) {
        if (properties)
            for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                if (properties[keys[i]] != null)
                    this[keys[i]] = properties[keys[i]];
    }

    /**
     * UserLoginLogResp model.
     * @member {string} model
     * @memberof UserLoginLogResp
     * @instance
     */
    UserLoginLogResp.prototype.model = "";

    /**
     * UserLoginLogResp loginTime.
     * @member {string} loginTime
     * @memberof UserLoginLogResp
     * @instance
     */
    UserLoginLogResp.prototype.loginTime = "";

    /**
     * UserLoginLogResp deviceId.
     * @member {string} deviceId
     * @memberof UserLoginLogResp
     * @instance
     */
    UserLoginLogResp.prototype.deviceId = "";

    /**
     * Creates a new UserLoginLogResp instance using the specified properties.
     * @function create
     * @memberof UserLoginLogResp
     * @static
     * @param {IUserLoginLogResp=} [properties] Properties to set
     * @returns {UserLoginLogResp} UserLoginLogResp instance
     */
    UserLoginLogResp.create = function create(properties) {
        return new UserLoginLogResp(properties);
    };

    /**
     * Encodes the specified UserLoginLogResp message. Does not implicitly {@link UserLoginLogResp.verify|verify} messages.
     * @function encode
     * @memberof UserLoginLogResp
     * @static
     * @param {IUserLoginLogResp} message UserLoginLogResp message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    UserLoginLogResp.encode = function encode(message, writer) {
        if (!writer)
            writer = $Writer.create();
        if (message.model != null && Object.hasOwnProperty.call(message, "model"))
            writer.uint32(/* id 1, wireType 2 =*/10).string(message.model);
        if (message.loginTime != null && Object.hasOwnProperty.call(message, "loginTime"))
            writer.uint32(/* id 2, wireType 2 =*/18).string(message.loginTime);
        if (message.deviceId != null && Object.hasOwnProperty.call(message, "deviceId"))
            writer.uint32(/* id 3, wireType 2 =*/26).string(message.deviceId);
        return writer;
    };

    /**
     * Encodes the specified UserLoginLogResp message, length delimited. Does not implicitly {@link UserLoginLogResp.verify|verify} messages.
     * @function encodeDelimited
     * @memberof UserLoginLogResp
     * @static
     * @param {IUserLoginLogResp} message UserLoginLogResp message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    UserLoginLogResp.encodeDelimited = function encodeDelimited(message, writer) {
        return this.encode(message, writer).ldelim();
    };

    /**
     * Decodes a UserLoginLogResp message from the specified reader or buffer.
     * @function decode
     * @memberof UserLoginLogResp
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @param {number} [length] Message length if known beforehand
     * @returns {UserLoginLogResp} UserLoginLogResp
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    UserLoginLogResp.decode = function decode(reader, length) {
        if (!(reader instanceof $Reader))
            reader = $Reader.create(reader);
        let end = length === undefined ? reader.len : reader.pos + length, message = new $root.UserLoginLogResp();
        while (reader.pos < end) {
            let tag = reader.uint32();
            switch (tag >>> 3) {
            case 1: {
                    message.model = reader.string();
                    break;
                }
            case 2: {
                    message.loginTime = reader.string();
                    break;
                }
            case 3: {
                    message.deviceId = reader.string();
                    break;
                }
            default:
                reader.skipType(tag & 7);
                break;
            }
        }
        return message;
    };

    /**
     * Decodes a UserLoginLogResp message from the specified reader or buffer, length delimited.
     * @function decodeDelimited
     * @memberof UserLoginLogResp
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @returns {UserLoginLogResp} UserLoginLogResp
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    UserLoginLogResp.decodeDelimited = function decodeDelimited(reader) {
        if (!(reader instanceof $Reader))
            reader = new $Reader(reader);
        return this.decode(reader, reader.uint32());
    };

    /**
     * Verifies a UserLoginLogResp message.
     * @function verify
     * @memberof UserLoginLogResp
     * @static
     * @param {Object.<string,*>} message Plain object to verify
     * @returns {string|null} `null` if valid, otherwise the reason why it is not
     */
    UserLoginLogResp.verify = function verify(message) {
        if (typeof message !== "object" || message === null)
            return "object expected";
        if (message.model != null && message.hasOwnProperty("model"))
            if (!$util.isString(message.model))
                return "model: string expected";
        if (message.loginTime != null && message.hasOwnProperty("loginTime"))
            if (!$util.isString(message.loginTime))
                return "loginTime: string expected";
        if (message.deviceId != null && message.hasOwnProperty("deviceId"))
            if (!$util.isString(message.deviceId))
                return "deviceId: string expected";
        return null;
    };

    /**
     * Creates a UserLoginLogResp message from a plain object. Also converts values to their respective internal types.
     * @function fromObject
     * @memberof UserLoginLogResp
     * @static
     * @param {Object.<string,*>} object Plain object
     * @returns {UserLoginLogResp} UserLoginLogResp
     */
    UserLoginLogResp.fromObject = function fromObject(object) {
        if (object instanceof $root.UserLoginLogResp)
            return object;
        let message = new $root.UserLoginLogResp();
        if (object.model != null)
            message.model = String(object.model);
        if (object.loginTime != null)
            message.loginTime = String(object.loginTime);
        if (object.deviceId != null)
            message.deviceId = String(object.deviceId);
        return message;
    };

    /**
     * Creates a plain object from a UserLoginLogResp message. Also converts values to other types if specified.
     * @function toObject
     * @memberof UserLoginLogResp
     * @static
     * @param {UserLoginLogResp} message UserLoginLogResp
     * @param {$protobuf.IConversionOptions} [options] Conversion options
     * @returns {Object.<string,*>} Plain object
     */
    UserLoginLogResp.toObject = function toObject(message, options) {
        if (!options)
            options = {};
        let object = {};
        if (options.defaults) {
            object.model = "";
            object.loginTime = "";
            object.deviceId = "";
        }
        if (message.model != null && message.hasOwnProperty("model"))
            object.model = message.model;
        if (message.loginTime != null && message.hasOwnProperty("loginTime"))
            object.loginTime = message.loginTime;
        if (message.deviceId != null && message.hasOwnProperty("deviceId"))
            object.deviceId = message.deviceId;
        return object;
    };

    /**
     * Converts this UserLoginLogResp to JSON.
     * @function toJSON
     * @memberof UserLoginLogResp
     * @instance
     * @returns {Object.<string,*>} JSON object
     */
    UserLoginLogResp.prototype.toJSON = function toJSON() {
        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
    };

    /**
     * Gets the default type url for UserLoginLogResp
     * @function getTypeUrl
     * @memberof UserLoginLogResp
     * @static
     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
     * @returns {string} The default type url
     */
    UserLoginLogResp.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
        if (typeUrlPrefix === undefined) {
            typeUrlPrefix = "type.googleapis.com";
        }
        return typeUrlPrefix + "/UserLoginLogResp";
    };

    return UserLoginLogResp;
})();

export { $root as default };
